/*

*/
var/list/idle_chatter = list(
"Hey, heard you were an adventurer! Hope it pays well."
)
npc
	parent_type = /mob
	var
		list
			verify_these
			dialog

		level_requirement	= 0
		class_requirement	= 0

		talks_randomly

		walks_randomly //TODO: work "townie" ai in

	proc
		talks_to(player/clicker)
			return !dialog.len || clicker.level < level_requirement  || !(clicker.class & class_requirement)

		talk(string)
			return "[name]: [string]"

		chatter(player/clicker)
			if(talks_randomly)
				var/o = pick(dialog)
				clicker << talk(o)
				verify(clicker, dialog.Find(o))

			else if(all_verified(clicker))
				clicker << talk(pick(dialog | idle_chatter))

			else
				for(var/o in dialog)
					clicker << talk(o)
					sleep(dialog[o] ? dialog[o] : 10)
					verify(clicker, dialog.Find(o))

		verify(player/clicker, position)
			if(!(verify_these[position] in clicker.verified_names))
				clicker.verified_names += verify_these[position]

		all_verified(player/clicker)
			for(var/o in verify_these)
				if(!(o in clicker.verified_names)) return FALSE
			return TRUE

	LeftDblClick(player/clicker, location, control, params)

		if(!talks_to(clicker))
			clicker << "I have nothing to say to you."
			return

		chatter(clicker)

	priests

		chatter(player/player)
			..(player)
			if(!(verify_these[1] in player.learned)) player.learned += verify_these[1]

		icon = 'taking.dmi'
		icon_state="Pale"

		fire_priest
			dialog = list("Let me IGNIte your soul with the baptismal power of fire!"=10)
			verify_these = list("igni")

		wind_priest
			dialog = list("Let me show to you the GUSTy blasts of wind!"=10)
			verify_these = list("gust")

		water_priest
			dialog = list("Let me bestow upon you the soothing LIQUId!"=10)
			verify_these = list("liqui")

		noise_priest
			dialog = list("Let me engage you with the blaring NOISE!"=10)
			verify_these = list("noise")

		earth_priest
			dialog = list("Let me help you to observe the calm TERRA!"=10)
			verify_these = list("igni")

		heal_priest
			dialog = list("Let me heal your body with the BLESSing of life!"=10)
			verify_these = list("bless")

		dark_priest
			dialog = list("Let me reveal to you the secrets of the DEVILA!"=10)
			verify_these = list("devila")

		light_priest
			dialog = list("Let me bless you with the teachings of ANGELIc light!"=10)
			verify_these = list("angeli")